import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";

@Injectable({
  providedIn: 'root'
})
export class SockCommodityBrandService {

  // tablelist--URL
  public tableListUrl = '/whGoodBrand/list/page';

  // 添加商品
  public addCommodityBrandUrl = '/whGoodBrand/add';

  // 修改商品
  public updateCommodityBrandUrl = '/whGoodBrand/update';

  // 删除商品
  public deleteCommodityBrandUrl = '/whGoodBrand/remove/';

  constructor(public httpClient: HttpClient) { }

  /**
   * 查询tabledata
   * @param params 
   * @returns 
   */
  public async queryTableData(params: any) {
    return await this.httpClient.get(this.tableListUrl, { params: params }).toPromise();
  }
  
  /**
   * 添加商品品牌
   * @param params 
   * @returns 
   */
   public async addCommodityBrandData(params: any) {
    return await this.httpClient.post(this.addCommodityBrandUrl, params).toPromise();
  }

  /**
   * 修啊商品品牌
   * @param params 
   * @returns 
   */
   public async updateCommodityBrandData(params: any) {
    return await this.httpClient.post(this.updateCommodityBrandUrl, params).toPromise();
  }

  /**
   * 删除商品品牌
   * @param params 
   * @returns 
   */
   public async deleteCommodityBrandData(id: any) {
    return await this.httpClient.get(this.deleteCommodityBrandUrl + id).toPromise();
  }
}



